import type { PageList, ResponseStruct } from '#/global'

export interface LiveVo {
  [key: string]: any
}

export interface LiveSearchVo {
  title?: string;
  page_size?:number;
}

export function page(data: LiveSearchVo): Promise<ResponseStruct<PageList<LiveVo>>> {
  return useHttp().get('/admin/live', { params: data })
}

export function create(data: LiveVo): Promise<ResponseStruct<null>> {
  return useHttp().post('/admin/live', data)
}

export function save(id: number, data: LiveVo): Promise<ResponseStruct<null>> {
  return useHttp().put(`/admin/live/${id}`, data)
}

export function deleteByIds(ids: number[]): Promise<ResponseStruct<null>> {
  return useHttp().delete('/admin/live', { data: ids })
}

export function all(params={}): Promise<ResponseStruct<LiveVo[]>> {
  return useHttp().get('/admin/live/all', { params })
}
